
use std::sync::mpsc;

use anyhow;

fn main() -> anyhow::Result<()> {
    let (rv, sv) = mpsc::channel::<i32>();


    let thread1 = std::thread::spawn(move || {
        rv.send(12);
    });

    let thread2 = std::thread::spawn(move || {
        let value = sv.recv().unwrap();
        println!("{}", value);
    });

    thread1.join();
    thread2.join();

    Ok(())
}